<?php 
  $class = null;
  if($phonecontact instanceof LandlinePhoneContact) $class = 'landline';
  elseif($phonecontact instanceof MobilePhoneContact) $class = 'mobile';
  elseif($phonecontact instanceof FaxPhoneContact) $class = 'fax';
  $class = $phonecontact->getType();
?>
<span class="phonecontact<?php echo ($class ? ' '.$class : '')?>">
  <span class="countrycode">
    <?php echo $phonecontact->Country->getCountryCodePhone ();?>
  </span>
  <span class="dialingcode">
    <span>
	  (<?php echo substr ( $phonecontact->getDialingCode (), 0, 1 )?>)
	</span>
	<?php echo substr ( $phonecontact->getDialingCode (), 1, strlen ( $phonecontact->getDialingCode () ) - 1 ) ?>
  </span>
  <span class="callthrough">
    <?php echo $phonecontact->getCallThrough ()?>
  </span>
</span>